<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested"%>
<H2>
	<bean:write name="productForm" property="categoryName" />
</H2>
<H3>Subcategories:</H3>
<table border="1">
	<tr>
		<td>Name</td>
		<td>Count</td>
	</tr>
	<nested:root name="productForm">
		<nested:nest property="document.rootElement.children[${productForm.categoryId}].children">
			<nested:iterate id="subcategory" indexId="subcategoryId">
				<bean:size id="size" name="subcategory" property="children" />
				<c:set var="goodsCount" value="${size}" />
				<tr>
					<td width="250">
						<nested:link action="productAction.do?method=goodsList&subcategoryId=${subcategoryId}"
								paramId="subcategoryName" paramName="subcategory"
								paramProperty="attributeValue(name)">
							<bean:write name="subcategory" property="attributeValue(name)" />
						</nested:link></td>
					<td>${goodsCount}</td>
				</tr>
			</nested:iterate>
		</nested:nest>
	</nested:root>
</table>
<nested:form action="productAction.do?method=categoryList">
	<input type="submit" name="buttonBack" value="Back"	style="width: 150px;" />
</nested:form>